package com.fs.sys.entityservice.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fs.common.base.service.AbstractBaseEntityService;
import com.fs.sys.bean.dto.WorkbenchCmpDTO;
import com.fs.sys.bean.query.WorkbenchCmpQuery;
import com.fs.sys.domain.entity.WorkbenchCmpEntity;
import com.fs.sys.domain.mapper.WorkbenchCmpMapper;
import com.fs.sys.entityservice.WorkbenchCmpEntityService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

/**
 * 工作台组件服务实现 
 * @author Coder Generator 2025-06-16 09:34:15 
 **/
@Service
public class WorkbenchCmpEntityServiceImpl extends AbstractBaseEntityService<WorkbenchCmpEntity, WorkbenchCmpDTO, WorkbenchCmpMapper, WorkbenchCmpQuery> implements WorkbenchCmpEntityService {
    @Override
    protected QueryWrapper<WorkbenchCmpEntity> queryToWrapper(WorkbenchCmpQuery query) {
        return this.createQueryWrapper()
                .eq(StringUtils.isNotBlank(query.getId()), "id", query.getId())
                .in(null != query.getIds(), "id", query.getIds())
                .eq(StringUtils.isNotBlank(query.getCode()), "code", query.getCode())
                .eq(null != query.getStatus(), "status", query.getStatus())
                .eq(StringUtils.isNotBlank(query.getName()), "name", query.getName())
                .orderByAsc("sort");
    }
}